<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <ui:composition template="./template.xhtml">
            <ui:define name="content">
                <h:form>
                <div id="calendarColumn" class="ui-grid-col-12">
                    
                        <p:growl id="messages" showDetail="true" />
                        <h:panelGrid id="calendarPanel" columnClasses="value">
                            <p:schedule id="calendar" value="#{otherCalendarBean.eventModel}" 
                                        draggable="false" resizable="false" 
                                        ignoreTimezone="false">
                                <p:ajax event="eventSelect" listener="#{otherCalendarBean.onEventSelect}" 
                                        update="eventDetails" 
                                        oncomplete="PF('eventDialog').show();"/>
                            </p:schedule>
                        </h:panelGrid>
                        
                        <p:dialog widgetVar="eventDialog" header="Event Details" showEffect="puff" hideEffect="puff">
                            <h:panelGrid id="eventDetails" columns="2">
                                <h:outputLabel for="name" value="Name:" 
                                               rendered="#{otherCalendarBean.event.isPublic}"/>
                                <h:outputText id="name" value="#{otherCalendarBean.event.name}"
                                              rendered="#{otherCalendarBean.event.isPublic}"/>

                                <h:outputLabel for="from" value="From:" />
                                <h:outputLabel id="from" value="#{otherCalendarBean.scheduleEvent.startDate}">
                                    <f:convertDateTime pattern="dd/MM/yyyy  HH:mm" timeZone="GMT+1"/>
                                </h:outputLabel>

                                <h:outputLabel for="to" value="To:" />
                                <h:outputText id="to" value="#{otherCalendarBean.scheduleEvent.endDate}">
                                    <f:convertDateTime pattern="dd/MM/yyyy  HH:mm" timeZone="GMT+1"/>
                                </h:outputText>

                                <p:commandLink ajax="false" action="/user/eventDetails.xhtml"
                                               value="Show Details"
                                               rendered="#{otherCalendarBean.event.isPublic}">
                                    <f:param name="idEvent" value="#{otherCalendarBean.event.id}"/>
                                </p:commandLink>
                            </h:panelGrid>
                        </p:dialog> 
                    

                    <style type="text/css">
                        .value {
                            width: 3000px;
                        }
                    </style>
                </div>
            </h:form>
            </ui:define>
        </ui:composition>
</html>